import { Entity } from "../../../../../Core/Module/Entity/Entity";
import { SceneType } from "../../../../../Core/Module/Entity/SceneType";
import { IAwake } from "../../../../../Core/Module/EventSystem/IAwakeSystem";
import { IDestroy } from "../../../../../Core/Module/EventSystem/IDestroySystem";
import { ILoad } from "../../../../../Core/Module/EventSystem/ILoadSystem";
import { ImplementsInterface, Type } from "../../../../../Decorator/Decorator";
import { List } from "../../../../../Support/Share/Lib/Collections/List";
import { Dictionary } from "../../../../../Support/Share/Lib/Dictionary";
import { IMActorHandler } from "./IMActorHandler";

export class ActorMessageDispatcherInfo {

    public get SceneType(): SceneType {
        return this.sceneType;
    }

    public get IMActorHandler(): IMActorHandler {
        return this.imActorHandler;
    }

    constructor(private sceneType: SceneType, private imActorHandler: IMActorHandler) {

    }
}

@ImplementsInterface(IAwake)
@ImplementsInterface(IDestroy)
@ImplementsInterface(ILoad)
export class ActorMessageDispatcherComponent extends Entity implements IAwake, IDestroy, ILoad {

    public static Instance: ActorMessageDispatcherComponent;

    public readonly ActorMessageHandlers: Dictionary<Type, List<ActorMessageDispatcherInfo>> = new Dictionary<Type, List<ActorMessageDispatcherInfo>>();

}